import { IsNotEmpty, IsString, IsOptional, IsBoolean, MaxLength, Matches } from 'class-validator';

export class CreateWebsiteDto {
  @IsNotEmpty()
  @IsString()
  @MaxLength(100)
  @Matches(/^[a-zA-Z0-9][a-zA-Z0-9-_.]*\.[a-zA-Z0-9-_.]+$/, {
    message: '域名格式无效',
  })
  domain: string;

  @IsNotEmpty()
  @IsString()
  @MaxLength(255)
  name: string;

  @IsOptional()
  @IsString()
  description?: string;

  @IsOptional()
  @IsBoolean()
  ignoreLocalhost?: boolean;

  @IsOptional()
  @IsBoolean()
  collectIp?: boolean;

  @IsOptional()
  @IsBoolean()
  collectUserAgent?: boolean;

  @IsOptional()
  @IsBoolean()
  collectReferrer?: boolean;
} 